package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description:
 * @Version: V1.0
 */
@Mapper
@Repository
public interface UserMapper {
    @Select("select * from t_user")
    public List<User> findAll();
    @Insert("insert into t_user (id,username,password) values (#{id},#{username},#{password})")
    public void add(User user);
    @Update("update t_user set username=#{username},password=#{password} where id=#{id}")
    public void update(User user);
    @Delete("delete from t_user where id=#{id}")
    public void delete(int id);


}
